package com.jdrx.ocp.dao;

import com.jdrx.ocp.beans.entity.ResourcePO;
import com.jdrx.ocp.beans.vo.QueryUserResourceVO;
import com.jdrx.platform.jdbc.dao.BaseDAO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author huangxg
 */
@Mapper
public interface ResourceDAO extends BaseDAO<ResourcePO> {

    List<ResourcePO> listByUser(Map<String, Object> map);

    public List<ResourcePO> findByUid(Long uid);

    /**
     * 获取资源
     *
     * @param map
     * @return
     */
    List<QueryUserResourceVO> queryResourceByIds(Map<String, Object> map);

    /**
     * 获取指定平台的所有可用资源数据
     *
     * @param prefix
     * @return
     */
    List<QueryUserResourceVO> queryByPrefix(String prefix);

    /**
     * 获取拥有指定资源的用户集
     *
     * @param resId
     * @return
     */
    List<Long> queryUserIdsByResourceId(@Param("resId") Long resId);
}